package com.migu.rbac.controller;

import com.migu.rbac.documented.MyTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testController {

    @Autowired
    private TestService testService;

    @GetMapping("test")
    @MyTest
    public String test() throws Exception {
        String a = "hello world";
        String b = "hello world";
        System.out.println(a == b);
        System.out.println(a.equals(b));
        testService.test();
        return "333";
    }

    public static synchronized void main(String[] args) {
        String a = "hello world";
        String b = "hello world";
        String c = new String("hello world");
        String d = "hello ";
        String e = "world";
        String f = d + e;
        System.out.println(a == b);
        System.out.println(a.equals(b));
        System.out.println(a == c);
        System.out.println(a ==f);
    }
}
